{foreach from=$form.elements key=name item=element}
	{if isset($form.errors[$name])}
	<p class="error">{$form.errors[$name]}</p>
	{/if}
	<p>
        {assign var="caption" value=$element.caption}
        {if "hidden" == $element.template}{assign var="caption" value=false}{/if}
		{if false !== $caption}
            <label for="{$name}">{$caption}:{if $element.required} <span class="required">*</span>{/if}</label>
        {/if}
		{include file="component/form/"|cat:$element.template|cat:".tpl"}
	</p>
{/foreach}
